<!doctype html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <meta name="referrer" content="no-referrer-when-downgrade">
    

    <title>《Flutter应用集成浅析》 | 早起的年轻人</title>
    <meta property="og:title" content="《Flutter应用集成浅析》 - 早起的年轻人">
    <meta property="og:type" content="article">
        
    <meta property="article:published_time" content='2021-07-31T21:18:50&#43;08:00'>
        
        
    <meta property="article:modified_time" content='2021-07-31T21:18:50&#43;08:00'>
        
    <meta name="Keywords" content="Flutter，golang,go语言,go语言笔记,飞雪无情,java,android,博客,项目管理,python,软件架构,公众号,小程序">
    <meta name="description" content="《Flutter应用集成浅析》">
        
    <meta name="author" content="luckly">
    <meta property="og:url" content="https://luckly.work/post/Flutter%E5%BA%94%E7%94%A8%E9%9B%86%E6%88%90%E6%B5%85%E6%9E%90/">
    <link rel="shortcut icon" href='/favicon.ico'  type="image/x-icon">

    <link rel="stylesheet" href='/css/normalize.css'>
    <link rel="stylesheet" href='/css/style.css'>
    <script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

    
    
    
        <link href="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" rel="stylesheet">
    
    
    
    
        <link rel="stylesheet" href='/css/douban.css'>
    
        <link rel="stylesheet" href='/css/other.css'>
    
</head>

<link rel="stylesheet"
      href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js"></script>
<body>
    <header id="header" class="clearfix">
    <div class="container">
        <div class="col-group">
            <div class="site-name ">
                
                    <a id="logo" href="https://luckly.work/">
                        早起的年轻人
                    </a>
                
                <p class="description">专注于Flutter、Android、Java、Go语言(golang)、移动互联网、项目管理、软件架构</p>
            </div>
            <div>
                <nav id="nav-menu" class="clearfix">
                    <a class="current" href="https://luckly.work/">首页</a>
                    
                    <a  href="https://luckly.work/categories/" title="分类">分类</a>
                    
                    <a  href="https://luckly.work/tags/" title="标签">标签</a>
                    
                    <a  href="https://luckly.work/about/" title="关于我">关于我</a>
                    
                    <a  href="https://github.com/ITmxs/" title="github">github</a>
                    
                </nav>
            </div>
        </div>
    </div>
</header>

    <div id="body">
        <div class="container">
            <div class="col-group">

                <div class="col-8" id="main">
                    
<div class="res-cons">
    <style type="text/css">
    .post-toc {
        position: fixed;
        width: 200px;
        margin-left: -210px;
        padding: 5px 10px;
        font-family: Athelas, STHeiti, Microsoft Yahei, serif;
        font-size: 12px;
        border: 1px solid rgba(0, 0, 0, .07);
        border-radius: 5px;
        background-color: rgba(255, 255, 255, 0.98);
        background-clip: padding-box;
        -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        word-wrap: break-word;
        white-space: nowrap;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        z-index: 999;
        cursor: pointer;
        max-height: 70%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .post-toc .post-toc-title {
        width: 100%;
        margin: 0 auto;
        font-size: 20px;
        font-weight: 400;
        text-transform: uppercase;
        text-align: center;
    }

    .post-toc .post-toc-content {
        font-size: 15px;
    }

    .post-toc .post-toc-content>nav>ul {
        margin: 10px 0;
    }

    .post-toc .post-toc-content ul {
        padding-left: 20px;
        list-style: square;
        margin: 0.5em;
        line-height: 1.8em;
    }

    .post-toc .post-toc-content ul ul {
        padding-left: 15px;
        display: none;
    }

    @media print,
    screen and (max-width:1057px) {
        .post-toc {
            display: none;
        }
    }
</style>
<div class="post-toc" style="position: absolute; top: 188px;">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
        <nav id="TableOfContents">
  <ul>
    <li><a href="#添加-flutter-task">添加 Flutter Task</a>
      <ul>
        <li><a href="#addflutterdeps">addFlutterDeps</a></li>
        <li><a href="#configureplugins">configurePlugins</a></li>
      </ul>
    </li>
    <li><a href="#添加-flutter-dependency">添加 Flutter Dependency</a></li>
  </ul>

  <ul>
    <li><a href="#编译失败-cause-assert-appproject--null">编译失败 Cause: assert appProject != null</a></li>
    <li><a href="#找不到-libflutterso-或-libappso">找不到 <code>libflutter.so</code> 或 <code>libapp.so</code></a></li>
  </ul>
</nav>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var postToc = $(".post-toc");
        if (postToc.length) {
            var leftPos = $("#main").offset().left;
            if(leftPos<220){
                postToc.css({"width":leftPos-10,"margin-left":(0-leftPos)})
            }

            var t = postToc.offset().top - 20,
                a = {
                    start: {
                        position: "absolute",
                        top: t
                    },
                    process: {
                        position: "fixed",
                        top: 20
                    },
                };
            $(window).scroll(function () {
                var e = $(window).scrollTop();
                e < t ? postToc.css(a.start) : postToc.css(a.process)
            })
        }
    })
</script>
    <article class="post">
        <header>
            <h1 class="post-title">《Flutter应用集成浅析》</h1>
        </header>
        <date class="post-meta meta-date">
            2021年7月31日
        </date>
        
        <div class="post-meta">
            <span>|</span>
            
            <span class="meta-category"><a href='/categories/flutter'>flutter</a></span>
            
        </div>
        
        
        <div class="post-meta">
            <span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span>
                    阅读</span></span>
        </div>
        
        
        <div class="clear" style="display: none">
            <div class="toc-article">
                <div class="toc-title">文章目录</div>
            </div>
        </div>
        
        <div class="post-content">
            <blockquote>
<p>本文主要简单分析下 Flutter 如何集成到现有 Android 应用中。</p>
</blockquote>
<h1 id="前言">前言</h1>
<p>截止目前 Flutter (1.12.13+hotfix.5)，集成到 Android 应用已经非常简单了。</p>
<blockquote>
<p>Flutter can be embedded into your existing Android application piecemeal, as a source code Gradle subproject or as AARs.</p>
</blockquote>
<p>无非两种集成方式：源码集成或 AAR 产物集成。，这里不再赘述，仅做简单总结。</p>
<ul>
<li>Android Studio 3.6 + Flutter IntelliJ plugin (version 42及以上) 可以方便快速地自动集成 Flutter 模块</li>
<li>Flutter 的 Android 引擎使用 Java 8 特性，所以要记得开启 1.8 兼容，否则会提示 “default interface methods” 问题</li>
<li><a href="https://flutter.dev/docs/development/add-to-app/android/project-setup#option-b---depend-on-the-modules-source-code">源码集成</a> 时注意 Android 工程和 Flutter 工程在同级目录下</li>
<li>注意编译模式及CPU架构，不匹配的话会出现找不到 <code>libflutter.so</code> 的问题</li>
<li>Flutter 的 AOT(ahead of time) 编译产物只支持 <code>armeabi-v7a</code> 和 <code>arm64-v8a</code>，x86 下可进行 debug (Just-In-Time, JIT 模式)，但不能安装 release 包</li>
</ul>
<h1 id="产物集成">产物集成</h1>
<p>产物集成相比源码集成更简单。主要步骤如下，具体过程可参考<a href="https://flutter.dev/docs/development/add-to-app/android/project-setup#create-a-flutter-module">官方文档</a>。</p>
<p>第一步，生成 AAR。</p>
<pre><code>cd flutter_project
flutter build aar
</code></pre><p>缺省编译所有模式下的产物，包括 debug, profile 和 release。不想编译 profile 模式产物的话，加上 <code>--no-profile</code> 即可。</p>
<p>另外注意编译 AAR 有限制，仅能为 plugin 或 module 工程编译 AAR 产物，否则提示如下错误。</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg">
            <img class="mx-auto" alt="-w541" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg" />
        </a>
    </p>
<p>第二步，添加产物仓库及依赖。</p>
<pre><code>repositories {
  // AAR 产物本地仓库
  maven {
      url '/Users/user/wd/xyz/build/host/outputs/repo'
  }
  // Flutter 框架官方仓库
  maven {
      url 'http://download.flutter.io'
  }
}
dependencies {
  debugImplementation 'com.tencent.xyz:flutter_debug:1.0
  profileImplementation 'com.tencent.xyz:flutter_profile:1.0
  releaseImplementation 'com.tencent.xyz:flutter_release:1.0
}
</code></pre><p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg">
            <img class="mx-auto" alt="-w700" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg" />
        </a>
    </p>
<h1 id="源码集成">源码集成</h1>
<p>第一步，创建 Flutter 项目。在 host app 的同级目录下创建 <code>my_flutter</code> 项目：</p>
<pre><code>$ cd some/path/
$ flutter create -t module --org com.example my_flutter
</code></pre><p>第二步，引入 Flutter 项目并作为模块。在 host app 的 <code>settings.gradle</code> 文件中添加如下配置：</p>
<pre><code>...
setBinding(new Binding([gradle: this]))                                 // new
evaluate(new File(                                                      // new
  settingsDir.parentFile,                                               // new
  'my_flutter/.android/include_flutter.groovy'                          // new
)) 
include ':my_flutter'
project(':my_flutter').projectDir = new File('../my_flutter')
</code></pre><p>这段配置的作用不妨视作黑魔法，其作用如下：</p>
<ul>
<li>将 <code>my_flutter</code> <strong>Flutter Project</strong> 作为名为 <code>:flutter</code> 的 <strong>Android Library Module</strong>，引入到当前 <strong>Android Project</strong></li>
<li>查找并保存 <code>my_flutter</code> 依赖的 Flutter 插件</li>
</ul>
<p>第三步，添加对 <code>:flutter</code> module 的依赖。在 host app 的 <code>build.gradle</code> 中加上以下配置：</p>
<pre><code>dependencies {
  implementation project(':flutter')
}
</code></pre><p>以上是手工操作步骤。在 Android 3.6 中可以自动操作，同样也会产生跟上面相同的配置。</p>
<p>Android Studio 3.6 中打开 host app，并新建一个 Flutter Module：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg">
            <img class="mx-auto" alt="-w633" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg" />
        </a>
    </p>
<p>创建完成后生成的配置如下：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg">
            <img class="mx-auto" alt="-w1185" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg" />
        </a>
    </p>
<p>可见，无论手工操作还是自动操作，源码集成的关键在于这几个脚本：</p>
<ul>
<li><del>my_flutter/.android/include_flutter.groovy</del> - 黑魔法，用于在 Android 工程引入 Flutter 工程，我们略过</li>
<li><code>my_flutter/.android/Flutter/build.gradle</code> - 这个脚本决定 Flutter 工程如何构建，它引入 Flutter SDK 中的 <code>flutter.gradle</code> 脚本</li>
<li><code>&lt;Flutter SDK&gt;/packages/flutter_tools/gradle/flutter.gradle</code> - 集成 Flutter 工程的核心</li>
</ul>
<p>接下来我将分析 <code>build.gradle</code> 和 <code>flutter.gradle</code> 两个脚本是如何将 Flutter 集成到 Android 应用的。</p>
<h1 id="buildgradle">build.gradle</h1>
<p>先来分析 <code>my_flutter/.android/Flutter/build.gradle</code>。</p>
<p>第一步，加载并解析 <code>.android</code> 目录下的 <code>local.properties</code> 文件。</p>
<pre><code>// 加载 .android 目录下的 local.properties 文件
def localProperties = new Properties()
def localPropertiesFile = new File(buildscript.sourceFile.parentFile.parentFile, 'local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader -&gt;
        localProperties.load(reader)
    }
}

// 解析 flutter.sdk(必选)
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException(&quot;Flutter SDK not found. Define location with flutter.sdk in the local.properties file.&quot;)
}

// 解析 flutter.versionCode(可选)
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

// 解析 flutter.versionName(可选)
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}
</code></pre><p>第二步，引入 <code>flutter.gradle</code> 脚本并通过 <code>flutter</code> 插件指定 <strong>Flutter Project</strong> 源码位置。<code>flutter</code> 插件来自 <code>flutter.gradle</code> 脚本中的 <code>FlutterPlugin</code>。</p>
<pre><code>apply from: &quot;$flutterRoot/packages/flutter_tools/gradle/flutter.gradle&quot;

...

// 指定的 Flutter 源码路径
flutter {
    source '../..'
}

...
</code></pre><h1 id="fluttergradlehttpsgithubcomflutterflutterblobmasterpackagesflutter_toolsgradlefluttergradle"><a href="https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/flutter.gradle">flutter.gradle</a></h1>
<p>再来看 <code>&lt;Flutter SDK&gt;/packages/flutter_tools/gradle/flutter.gradle</code>。<code>flutter</code> 插件的具体实现在 <code>apply()</code> 方法。</p>
<pre><code>// 应用 FlutterPlugin
apply plugin: FlutterPlugin

// 定义名为 flutter 的 FlutterPlugin 插件
class FlutterPlugin implements Plugin&lt;Project&gt; {
    private Project project

    @Override
    void apply(Project project) {
        this.project = project
        // 创建名为 flutter 的 FlutterExtension
        project.extensions.create(&quot;flutter&quot;, FlutterExtension) 
        // 添加 Flutter Task
        project.afterEvaluate this.&amp;addFlutterTasks
        // 配置 APK。修改 project.android (android插件)的配置
        ...
        // 获取 Flutter 相关信息
        // 添加 Flutter Dependency
        project.android.buildTypes.each this.&amp;addFlutterDependencies
        project.android.buildTypes.whenObjectAdded this.&amp;addFlutterDependencies
    }
}
</code></pre><p><code>apply()</code> 主要流程概括如下：</p>
<ul>
<li>创建 FlutterExtension。这个插件很简单，只包括
<ul>
<li><code>source</code>(源码路径)</li>
<li><code>target</code>(Dart入口，通常是 <code>lib/main.dart</code>)</li>
</ul>
</li>
<li><strong>添加 Flutter Task</strong></li>
<li>配置 APK
<ul>
<li>针对 Target Platform 生成 multiple APK 或 fat APK</li>
<li>配置 build type，例如是否压缩资源</li>
</ul>
</li>
<li>获取 Flutter 相关信息
<ul>
<li>本地 Flutter SDK 路径</li>
<li><code>flutter</code> 命令</li>
<li>引擎版本</li>
<li>引擎路径 (来自 <code>gradle.properties</code> 文件的 <code>local-engine-out</code> 属性 )</li>
</ul>
</li>
<li><strong>添加 Flutter Dependency</strong></li>
</ul>
<p>接下来我们挑重点说，</p>
<ul>
<li>添加 Flutter Task</li>
<li>添加 Flutter Dependency</li>
</ul>
<p>简单来说，添加 Flutter Task 是添加一些 Task 用于处理三类 Flutter 相关的资源，库、资源、插件：</p>
<ul>
<li>库 - 库是编译过程中生成jar文件和so文件。库文件应正确地打包到 AAR 或 APK</li>
<li>资源 - 资源是 <code>pubspec.yaml</code> 文件添加指定的各类资源，如图片、字体等。资源文件应正确地打包到 AAR 或 APK</li>
<li>插件 - 插件是 <code>pubspec.yaml</code> 文件添加的各种 Dart 库。插件的处理比较麻烦，一是某些插件包含原生Java或OC代码，二是插件之间有依赖关系</li>
</ul>
<p>而添加 Flutter Dependency 则是将 Flutter 框架(包括引擎)添加为 Android 工程的依赖，具体包括：</p>
<ul>
<li><code>flutter_embedding.jar</code> - Flutter Framework，即 <code>io.flutter.embedding.android.FlutterActivity</code> 所在的 Java 库</li>
<li><code>libflutter.so</code> - Flutter 引擎</li>
</ul>
<hr>
<p>跟以上流程相关的几个辅助方法：</p>
<ul>
<li><code>useLocalEngine()</code> - 判断是否使用本地 Flutter 引擎，来自 <code>gradle.properties</code> 文件的 <code>local-engine-repo</code> 属性</li>
<li><code>getTargetPlatforms</code> - 获取 Target Platform，来自 <code>gradle.properties</code> 文件的 <code>target-platform</code> 属性</li>
<li><code>shouldSplitPerAbi()</code> - 判断是否生成 multiple APK (即针对每种架构生成一个 APK，与之对应的是 fat APK)，来自 <code>gradle.properties</code> 文件的 <code>split-per-abi</code> 属性，缺省为 <code>false</code></li>
<li><code>getPluginList()</code> - 解析 <code>.flutter-plugins</code> 文件获取插件列表</li>
<li><code>getPluginDependencies()</code> - 解析 <code>.flutter-plugins-dependencies</code> 文件获取插件依赖</li>
</ul>
<hr>
<h2 id="添加-flutter-task">添加 Flutter Task</h2>
<p><code>addFlutterTasks()</code> 是最复杂的方法。精简后的代码如下：</p>
<pre><code>private void addFlutterTasks(Project project) {
    // 1. 参数检查
    ...
    // 2. 从 `gradle.properties` 获取各种参数
    ...
    // 3. 定义 addFlutterDeps 匿名方法
    def addFlutterDeps = { variant -&gt; 
    
    }
    ...
    // 4. 为所有 applicationVariants 或 libraryVariants 添加 Flutter 依赖
    if (project.android.hasProperty(&quot;applicationVariants&quot;)) {
        project.android.applicationVariants.all addFlutterDeps
    } else {
        project.android.libraryVariants.all addFlutterDeps
    }
    // 5. 配置插件依赖
    configurePlugins()
}
</code></pre><ul>
<li>第3步和第4步处理库和资源</li>
<li>第5步处理插件</li>
</ul>
<h3 id="addflutterdeps">addFlutterDeps</h3>
<p>首先看第3步 <code>addFlutterDeps</code> 的创建。</p>
<pre><code>// 1. 创建 compileTask。FlutterTask 实际是对 flutter build 命令的包装
FlutterTask compileTask = project.tasks.create(name: taskName, type: FlutterTask) {}

// 2. 创建 packFlutterAppAotTask。将第1步中的编译结果打包成 libs.jar 文件
Task packFlutterAppAotTask = project.tasks.create(name: &quot;packLibs${FLUTTER_BUILD_PREFIX}${variant.name.capitalize()}&quot;, type: Jar) {

// 3. 将第2步生成的 libs.jar 文件添加为依赖 
addApiDependencies(project, variant.name, project.files {
    packFlutterAppAotTask
}

// 4. 创建 copyFlutterAssetsTask。
Task copyFlutterAssetsTask = project.tasks.create(
    name: &quot;copyFlutterAssets${variant.name.capitalize()}&quot;,
    type: Copy,
) { ... }

// Flutter 项目可能作为插件编译或子项目编译(分别对应AAR产物集成和源码集成)
//  a) 当作为插件编译时，编译产物为 AAR
//  b) 当作为子项目编译时，编译产物为 APK

// 作为插件编译和作为子项目编译时对 assets 的处理是不一样的
// 第5步和第6步分别对这两种情况进行处理
boolean isUsedAsSubproject = ...

// 5. 处理作为插件编译时的 assets 拷贝
if (!isUsedAsSubproject) {
    return
}

// 6. 处理作为子项目编译时的 assets 拷贝
// Flutter module included as a subproject in add to app.
Project appProject = project.rootProject.findProject(':app')
appProject.afterEvaluate { ... }
</code></pre><p><code>FlutterTask</code> 继承自 <code>BaseFlutterTask</code>。<code>BaseFlutterTask</code> 实际是对 <code>flutter build</code> 命令的包装，具体包装过程可以参数 <a href="https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/flutter.gradle#L819">BaseFlutterTask.buildBundle()</a>。</p>
<h3 id="configureplugins">configurePlugins</h3>
<p>再来看 <code>configurePlugins()</code> 如何配置插件依赖。仍然分两种情况处理：源码集成和产物集成。代码如下：</p>
<pre><code>/**
 * Configures the Flutter plugin dependencies.
 *
 * The plugins are added to pubspec.yaml. Then, upon running `flutter pub get`,
 * the tool generates a `.flutter-plugins` file, which contains a 1:1 map to each plugin location.
 * Finally, the project's `settings.gradle` loads each plugin's android directory as a subproject.
 */
private void configurePlugins() {
    // 第1种情况，源码集成
    // 配置源码集成时的插件
    if (!buildPluginAsAar()) {
        // 1. 将 plugin 工程添加为 Android 工程的依赖
        getPluginList().each this.&amp;configurePluginProject
        // 2. 将 plugin 工程的依赖添加为 Android 工程的依赖
        getPluginDependencies().each this.&amp;configurePluginDependencies
        return
    }
    // 第2种情况，产物集成
    // 配置产物集成时的插件
    
    // 1. 将 plugin 工程的编译输出目录添加为 Android 工程的 maven 库
    project.repositories {
        maven {
            url &quot;${getPluginBuildDir()}/outputs/repo&quot;
        }
    }
    // 2. 将 plugin AAR 产物添加为 Android 工程的依赖
    getPluginList().each { pluginName, pluginPath -&gt;
        configurePluginAar(pluginName, pluginPath, project)
    }
}
</code></pre><p>另外，注释中提到了几个很重要的信息：</p>
<blockquote>
<p>插件在 pubspec.yaml 中添加。当运行 <code>flutter pub get</code> 命令时，工具会生成 <code>.flutter-plugins</code> 和 <code>.flutter-plugins-dependencies</code> 文件。<code>.flutter-plugins</code> 包含每个插件的位置，<code>.flutter-plugins-dependencies</code> 包含每个插件的依赖项</p>
<p>Android 项目的 <code>settings.gradle</code> 文件会加载每个插件为子工程</p>
</blockquote>
<p>以我们的项目为例。<code>.flutter-plugins</code> 文件内容如下：</p>
<pre><code># This is a generated file; do not edit or check into version control.
flutter_integration=/Users/abc/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_integration-0.0.1/
flutter_mmkv_cache=/Users/abc/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_mmkv_cache-0.0.2/
path_provider=/Users/abc/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.3.0/
sensors=/Users/abc/flutter/.pub-cache/hosted/pub.dartlang.org/sensors-0.4.1+8/
sqflite=/Users/abc/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.1.7+1/
</code></pre><p>该项目在 Android Studio 中看到的工程结构如下：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg">
            <img class="mx-auto" alt="-w249" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg" />
        </a>
    </p>
<h2 id="添加-flutter-dependency">添加 Flutter Dependency</h2>
<p><code>apply()</code> 的另一个要点是添加 Flutter 依赖，由 <code>addFlutterDependencies()</code> 实现。相比添加 Flutter Task，添加 Flutter 依赖则简单得多。</p>
<pre><code>class FlutterPlugin implements Plugin&lt;Project&gt; {
    @Override
    void apply(Project project) {
        ...   
        project.android.buildTypes.each this.&amp;addFlutterDependencies
        project.android.buildTypes.whenObjectAdded this.&amp;addFlutterDependencies
    }


    /**
     * addFlutterDependencies() 方法为 Flutter 工程添加 embedding 和 libflutter.so 依赖 
     *
     * Adds the dependencies required by the Flutter project.
     * This includes:
     *    1. The embedding
     *    2. libflutter.so
     */
    void addFlutterDependencies(buildType) {
        String flutterBuildMode = buildModeFor(buildType)
        if (!supportsBuildMode(flutterBuildMode)) {
            return
        }
        // 1. 添加 Flutter 引擎仓库，默认使用 MAVEN_REPO 
        // MAVEN_REPO 仓库地址 http://download.flutter.io
        String repository = useLocalEngine()
            ? project.property('local-engine-repo')
            : MAVEN_REPO

        project.rootProject.allprojects {
            repositories {
                maven {
                    url repository
                }
            }
        }
        // 2. 添加 embedding 依赖
        // Add the embedding dependency.
        addApiDependencies(project, buildType.name,
                &quot;io.flutter:flutter_embedding_$flutterBuildMode:$engineVersion&quot;)

        ...
        platforms.each { platform -&gt;
            String arch = PLATFORM_ARCH_MAP[platform].replace(&quot;-&quot;, &quot;_&quot;)
            // 3. 添加 libflutter.so 依赖
            // Add the `libflutter.so` dependency.
            addApiDependencies(project, buildType.name,
                    &quot;io.flutter:${arch}_$flutterBuildMode:$engineVersion&quot;)
        }
    }
}
</code></pre><h1 id="实践">实践</h1>
<p>通过看 <code>buid.gradle</code> 和 <code>flutter.gradle</code> 源码，我们对 Flutter 如何集成到 Android 项目中有一定的了解了。现在结合两个实例来加深理解，这里以一个编译失败问题和 so 加载失败问题为例。</p>
<h2 id="编译失败-cause-assert-appproject--null">编译失败 Cause: assert appProject != null</h2>
<p>Flutter 1.12.13+hotfix.5 有一个编译失败的 <a href="https://github.com/flutter/flutter/issues/42214">Issue #42214</a>，错误日志如下：</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg">
            <img class="mx-auto" alt="企业微信截图_d5221a9a-5eea-4c5d-9c8b-8f99449e06" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15843459718378.jpg" />
        </a>
    </p>
<p>问题来源：这个问题实际上来自 <code>flutter.gradle</code> 脚本中的一处 bug， 见<a href="https://github.com/flutter/flutter/pull/41333/files">Pull #41333</a>
问题分析：<code>addFlutterTasks()</code> 方法中第4步存在硬编码问题，<a href="https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/flutter.gradle#L724">默认所有的 app module 名为 <code>app</code></a>。实际项目中 app module 名很可能不是 <code>app</code>，所以断言失败，导致集成 Flutter 后编译出错</p>
<p>解决办法：要么将 app module 改名为 <code>app</code>，要么给本地的 <code>flutter.gradle</code> 打上如下补丁。注意要将 <code>IGame</code> 替换成实际项目名。</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15837916714301.jpg">
            <img class="mx-auto" alt="-w824" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15837916714301.jpg" />
        </a>
    </p>
<h2 id="找不到-libflutterso-或-libappso">找不到 <code>libflutter.so</code> 或 <code>libapp.so</code></h2>
<p>一些年代比较久远的 Android 项目中，so 往往放在 <code>lib/armeabi</code> 目录。</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15837916714301.jpg">
            <img class="mx-auto" alt="-w322" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15837916714301.jpg" />
        </a>
    </p>
<p>而 Flutter 的 AOT 产物只支持 <code>x86_64</code>、 <code>armeabi-v7a</code> 和 <code>arm64-v8a</code> 三种架构。另外，<strong>Flutter 的构建流程默认将会将 so 文件打包到对应的目录中</strong>，</p>
<p>
        <a data-fancybox="gallery" href="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15837916714301.jpg">
            <img class="mx-auto" alt="-w323" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/15837916714301.jpg" />
        </a>
    
所以会出现找不到 <code>libflutter.so</code> 的问题。一种简单而粗暴的解决方案见 <a href="https://tech.meituan.com/2018/08/09/waimai-flutter-practice.html">Flutter原理与实践 - 美团技术团队</a>。</p>
<p>Flutter 构建流程中 <code>packFlutterAppAotTask</code> 会将生成的 <code>app.so</code> 移动并重命名为 <code>lib/&lt;abi&gt;/libapp.so</code>。</p>
<pre><code>Task packFlutterAppAotTask = project.tasks.create(
  name: &quot;packLibs${FLUTTER_BUILD_PREFIX}${variant.name.capitalize()}&quot;, type: Jar) {
    destinationDir libJar.parentFile
    archiveName libJar.name
    dependsOn compileTask
    targetPlatforms.each { targetPlatform -&gt;
        String abi = PLATFORM_ARCH_MAP[targetPlatform]
        from(&quot;${compileTask.intermediateDir}/${abi}&quot;) {
            include &quot;*.so&quot;
            // Move `app.so` to `lib/&lt;abi&gt;/libapp.so`
            rename { String filename -&gt;
                return &quot;lib/${abi}/lib${filename}&quot;
            }
        }
    }
}
</code></pre><p>修改一：注意这里的 <code>&lt;abi&gt;</code> 只支持上述提到的三种架构，并不包括 <code>armeabi</code>。我们可以修改 <code>packFlutterAppAotTask</code>，修改后将 <code>app.so</code> 移动并重命名为 <code>lib/armeabi/libapp.so</code> 的目的。</p>
<p>修改二：修改原始的 embedding jar 包(<code>libflutter.so</code> 从原始的 <code>lib/armeabi-v7a</code> 移到 <code>lib/armeabi</code> 目录)，并在 <code>gradle.properties</code> 中提供 <code>local-engine-repo</code>，将其指向修改后的 embedding jar 包。具体见 <a href="https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/flutter.gradle#L198">addFlutterDependencies()</a></p>
<pre><code>/**
 * Adds the dependencies required by the Flutter project.
 * This includes:
 *    1. The embedding
 *    2. libflutter.so
 */
void addFlutterDependencies(buildType) {
    String flutterBuildMode = buildModeFor(buildType)
    if (!supportsBuildMode(flutterBuildMode)) {
        return
    }
    String repository = useLocalEngine()
        ? project.property('local-engine-repo')
        : MAVEN_REPO

    project.rootProject.allprojects {
        repositories {
            maven {
                url repository
            }
        }
    }
}
</code></pre><h1 id="参考">参考</h1>
<p><a href="https://flutter.dev/docs/development/add-to-app/android/project-setup">Integrate a Flutter module into your Android project - Flutter</a></p>
<p><a href="https://tech.youzan.com/you-zan-flutter-hun-bian-fang-an/">有赞 Flutter 混编方案</a></p>
        </div>

        
<div class="post-archive">
    <ul class="post-copyright">
        <li><strong>原文作者：</strong><a rel="author" href="https://luckly.work/">luckly</a></li>
        <li style="word-break:break-all"><strong>原文链接：</strong><a href="https://luckly.work/post/Flutter%E5%BA%94%E7%94%A8%E9%9B%86%E6%88%90%E6%B5%85%E6%9E%90/">https://luckly.work/post/Flutter%E5%BA%94%E7%94%A8%E9%9B%86%E6%88%90%E6%B5%85%E6%9E%90/</a></li>
        <li><strong>版权声明：</strong>本作品采用<a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议</a>进行许可，非商业转载请注明出处（作者，原文链接），商业转载请联系作者获得授权。</li>
    </ul>
</div>
<br/>



        

<div class="post-archive">
    <h2>See Also</h2>
    <ul class="listing">
        
        <li><a href="/post/Flutter-SizedOverflowBox-%E7%AE%80%E4%BB%8B%E5%8F%8A%E6%A1%88%E4%BE%8B/">《Flutter SizedOverflowBox 简介及案例》</a></li>
        
        <li><a href="/post/Flutter%E4%B9%8BStack%E7%94%A8%E6%B3%95%E5%B0%8F%E7%BB%93/">《Flutter之Stack用法小结》</a></li>
        
        <li><a href="/post/Flutter%E4%B9%8BprecacheImage%E8%A7%A3%E6%9E%90/">《Flutter之precacheImage（）解析》</a></li>
        
        <li><a href="/post/Flutter-drawFrame/">《Flutter DrawFrame（）》</a></li>
        
        <li><a href="/post/FlutterPerformance%E5%88%86%E6%9E%90%E5%B7%A5%E5%85%B7%E7%AE%80%E4%BB%8B/">《FlutterPerformance分析工具简介》</a></li>
        
    </ul>
</div>


        <div class="post-meta meta-tags">
            
            <ul class="clearfix">
                
                <li><a href='/tags/flutter'>flutter</a></li>
                
            </ul>
            
        </div>
    </article>
    
    

    
    
    <div class="post bg-white">
      <script src="https://utteranc.es/client.js"
            repo= "https://github.com/ITmxs/repo"
            issue-term="pathname"
            theme="github-light"
            crossorigin="anonymous"
            async>
      </script>
    </div>
    
</div>

                    <footer id="footer">
    <div>
        &copy; 2021 <a href="https://luckly.work/">早起的年轻人 By luckly</a>
        
        | <a rel="nofollow" target="_blank" href="http://beian.miit.gov.cn/">粤ICP备2021号-1</a>
        
    </div>
    <br />
    <div>
        <div class="github-badge">
            <a href="https://juejin.cn/user/3843548384077192" target="_black" rel="nofollow"><span class="badge-subject">Powered by</span><span class="badge-value bg-blue">掘金</span></a>
        </div>
        <div class="github-badge">
            <a href="https://space.bilibili.com/480883651" target="_black"><span class="badge-subject">Design by</span><span class="badge-value bg-brightgreen">早起的年轻人</span></a>
        </div>
        <div class="github-badge">
            <a href="https://cloud.tencent.com/developer/user/6702670" target="_black"><span class="badge-subject">Theme</span><span class="badge-value bg-yellowgreen">云社区</span></a>
        </div>
    </div>
</footer>


    
    <script type="text/javascript">
        window.MathJax = {
            tex2jax: {
                inlineMath: [['$', '$']],
                processEscapes: true
                }
            };
    </script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script><script src="https://cdn.bootcdn.net/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js"></script>

<a id="rocket" href="#top"></a>
<script type="text/javascript" src='/js/totop.js?v=0.0.0' async=""></script>



    <script type="text/javascript" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>




    <script src='/js/douban.js'></script>
    <script src="/js/copy-to-clipboard.js"></script>

                </div>

                <div id="secondary">
    <section class="widget">
        <form id="search" action='https://luckly.work/search/' method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
      
      <input type="text" name="q" maxlength="20" placeholder="Search">
      <input type="hidden" name="sitesearch" value="https://luckly.work/">
      <button type="submit" class="submit icon-search"></button>
</form>
    </section>
    
    <section class="widget">
        <h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
    
    <li>
        <a href="https://luckly.work/xxx/xxx.html" title="信息化和信息系统">信息化和信息系统</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/%E4%BD%BF%E7%94%A8flutter%E5%88%9B%E5%BB%BA%E6%B8%85%E5%8D%95/" title="使用flutter创建清单">使用flutter创建清单</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/%E4%BD%BF%E7%94%A8flutter%E5%88%9B%E5%BB%BA%E5%B8%A6%E6%9C%89%E5%8A%A8%E7%94%BB%E7%9A%84%E5%88%9B%E6%84%8F%E6%B8%85%E5%8D%95/" title="使用flutter创建带有动画的创意清单">使用flutter创建带有动画的创意清单</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/%E4%BD%BF%E7%94%A8flutter%E5%88%9B%E5%BB%BA%E6%90%9C%E7%B4%A2%E6%A0%8F/" title="使用flutter创建搜索栏">使用flutter创建搜索栏</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/%E4%BD%BF%E7%94%A8flutter%E5%88%9B%E5%BB%BA%E5%93%8D%E5%BA%94%E5%BC%8F%E4%B8%8B%E6%8B%89%E5%AF%BC%E8%88%AA%E6%A0%8F/" title="使用flutter创建响应式下拉导航栏">使用flutter创建响应式下拉导航栏</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/Flutter%E8%87%AA%E5%AE%9A%E4%B9%89%E5%BC%B9%E5%87%BA%E5%8A%A8%E7%94%BB/" title="Flutter自定义弹出动画">Flutter自定义弹出动画</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/Flutter_WEB/" title="Flutter_WEB">Flutter_WEB</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/Flutter%E7%B3%BB%E5%88%97%E5%88%97%E8%A1%A8%E5%92%8C%E7%BD%91%E6%A0%BC/" title="Flutter系列列表和网格">Flutter系列列表和网格</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/Flutter%E8%A7%86%E8%A7%89%E9%87%8D%E5%8F%A0%E6%8C%87%E5%8D%97paddingviewpadding%E5%92%8Cviewinsets/" title="Flutter视觉重叠指南padding，viewpadding和viewinsets">Flutter视觉重叠指南padding，viewpadding和viewinsets</a>
    </li>
    
    <li>
        <a href="https://luckly.work/post/Flutter/Flutter-ListView-%E5%92%8CScrollPhysics%E8%AF%A6%E7%BB%86%E4%BB%8B%E7%BB%8D/" title="Flutter ListView 和ScrollPhysics详细介绍">Flutter ListView 和ScrollPhysics详细介绍</a>
    </li>
    
</ul>
    </section>

    
<section class="widget">
    <h3 class="widget-title" style="color:red">福利派送</h3>
    <ul class="widget-list">
        
        <li>
            <a href="https://blog.csdn.net/qq_39132095?spm=1001.2101.3001.5343" title="我的CSDN" target="_blank" style="color:red">
                
                    <img src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/flutter.png">
                
            </a>
        </li>
        
        <li>
            <a href="https://space.bilibili.com/480883651" title="我的哔哩哔哩" target="_blank" style="color:red">
                
                    <img src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/flutter.png">
                
            </a>
        </li>
        
        <li>
            <a href="https://www.zhihu.com/people/yimi-yang-guang-96-65" title="我的知乎" target="_blank" style="color:red">
                
                    <img src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/flutter.png">
                
            </a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title"><a href='/categories/'>分类</a></h3>
<ul class="widget-list">
    
    <li><a href="https://luckly.work/categories/Go/">Go (1)</a></li>
    
    <li><a href="https://luckly.work/categories/IT/">IT (1)</a></li>
    
    <li><a href="https://luckly.work/categories/Mysql/">Mysql (1)</a></li>
    
    <li><a href="https://luckly.work/categories/Nginx/">Nginx (1)</a></li>
    
    <li><a href="https://luckly.work/categories/YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD/">YouTube视频下载 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/android/">android (6)</a></li>
    
    <li><a href="https://luckly.work/categories/dart/">dart (8)</a></li>
    
    <li><a href="https://luckly.work/categories/Flutter/">Flutter (141)</a></li>
    
    <li><a href="https://luckly.work/categories/git/">git (3)</a></li>
    
    <li><a href="https://luckly.work/categories/Go/">Go (4)</a></li>
    
    <li><a href="https://luckly.work/categories/ios/">ios (1)</a></li>
    
    <li><a href="https://luckly.work/categories/linux/">linux (1)</a></li>
    
    <li><a href="https://luckly.work/categories/read/">读书笔记 (6)</a></li>
    
    <li><a href="https://luckly.work/categories/redis/">redis (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99/">个人资料 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B9%A6%E5%8D%95/">书单 (8)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%B9%A6%E8%AF%84/">书评 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统管理师 (8)</a></li>
    
    <li><a href="https://luckly.work/categories/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统项目管理师 (16)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%8E%9F%E5%88%99/">原则 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%8E%9F%E7%94%9F%E9%80%9A%E8%AE%AF/">原生通讯 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%9F%BA%E7%A1%80/">基础 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%A4%8D%E5%88%A9%E6%95%88%E5%BA%94/">复利效应 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%B0%91%E6%9C%89%E4%BA%BA%E8%B5%B0%E7%9A%84%E8%B7%AF/">少有人走的路 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E5%BF%83%E8%AF%AD/">心语 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E6%8F%92%E4%BB%B6/">插件 (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E6%95%99%E5%AD%A6/">教学 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%8E%8B%E9%98%B3%E6%98%8E/">王阳明 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%94%B5%E5%AD%90%E4%B9%A6/">电子书 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%99%BB%E9%99%86%E8%A1%A8%E5%8D%95/">登陆表单 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%A8%BB%E7%9B%9B%E5%92%8C%E5%A4%AB/">稻盛和夫 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%A9%B7%E7%88%B8%E7%88%B8%E5%AF%8C%E7%88%B8%E7%88%B8/">穷爸爸富爸爸 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%B2%BE%E8%BF%9B/">精进 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E7%BC%96%E7%A8%8B/">编程 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B4%A2%E5%8A%A1%E8%87%AA%E7%94%B1%E4%B9%8B%E8%B7%AF/">财务自由之路 (2)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%91%E6%AD%A5/">跑步 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82/">路由传参 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%B7%AF%E7%BA%BF/">路线 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E8%BD%AF%E4%BB%B6%E5%AE%9E%E6%96%BD/">软件实施 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%98%B3%E6%98%8E%E5%BF%83%E5%AD%A6/">阳明心学 (3)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%A1%B9%E7%9B%AE/">项目 (1)</a></li>
    
    <li><a href="https://luckly.work/categories/%E9%AD%85%E5%8A%9B/">魅力 (1)</a></li>
    
</ul>
    </section>

    <section class="widget">
        <h3 class="widget-title"><a href='/tags/'>标签</a></h3>
<div class="tagcloud">
    
    <a href="https://luckly.work/tags/go/">go</a>
    
    <a href="https://luckly.work/tags/IT/">IT</a>
    
    <a href="https://luckly.work/tags/Mysql/">Mysql</a>
    
    <a href="https://luckly.work/tags/Nginx/">Nginx</a>
    
    <a href="https://luckly.work/tags/YouTube%E8%A7%86%E9%A2%91%E4%B8%8B%E8%BD%BD/">YouTube视频下载</a>
    
    <a href="https://luckly.work/tags/android/">android</a>
    
    <a href="https://luckly.work/tags/dart/">dart</a>
    
    <a href="https://luckly.work/tags/flutter/">flutter</a>
    
    <a href="https://luckly.work/tags/git/">git</a>
    
    <a href="https://luckly.work/tags/go/">go</a>
    
    <a href="https://luckly.work/tags/ios/">ios</a>
    
    <a href="https://luckly.work/tags/linux/">linux</a>
    
    <a href="https://luckly.work/tags/redis/">redis</a>
    
    <a href="https://luckly.work/tags/%E4%B8%AA%E4%BA%BA%E8%B5%84%E6%96%99/">个人资料</a>
    
    <a href="https://luckly.work/tags/%E4%B9%A6%E5%8D%95/">书单</a>
    
    <a href="https://luckly.work/tags/%E4%B9%A6%E8%AF%84/">书评</a>
    
    <a href="https://luckly.work/tags/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统管理师</a>
    
    <a href="https://luckly.work/tags/%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F%E9%A1%B9%E7%9B%AE%E7%AE%A1%E7%90%86%E5%B8%88/">信息系统项目管理师</a>
    
    <a href="https://luckly.work/tags/%E5%85%A5%E9%97%A8/">入门</a>
    
    <a href="https://luckly.work/tags/%E5%8E%9F%E5%88%99/">原则</a>
    
    <a href="https://luckly.work/tags/%E5%8E%9F%E7%94%9F%E9%80%9A%E8%AE%AF/">原生通讯</a>
    
    <a href="https://luckly.work/tags/%E5%9F%BA%E7%A1%80/">基础</a>
    
    <a href="https://luckly.work/tags/%E5%A4%8D%E5%88%A9%E6%95%88%E5%BA%94/">复利效应</a>
    
    <a href="https://luckly.work/tags/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">安装教程</a>
    
    <a href="https://luckly.work/tags/%E5%B0%91%E6%9C%89%E4%BA%BA%E8%B5%B0%E7%9A%84%E8%B7%AF/">少有人走的路</a>
    
    <a href="https://luckly.work/tags/%E5%BF%83%E8%AF%AD/">心语</a>
    
    <a href="https://luckly.work/tags/%E6%8F%92%E4%BB%B6/">插件</a>
    
    <a href="https://luckly.work/tags/%E6%95%99%E5%AD%A6/">教学</a>
    
    <a href="https://luckly.work/tags/%E7%8E%8B%E9%98%B3%E6%98%8E/">王阳明</a>
    
    <a href="https://luckly.work/tags/%E7%94%B5%E5%AD%90%E4%B9%A6/">电子书</a>
    
    <a href="https://luckly.work/tags/%E7%99%BB%E9%99%86%E8%A1%A8%E5%8D%95/">登陆表单</a>
    
    <a href="https://luckly.work/tags/%E7%A8%BB%E7%9B%9B%E5%92%8C%E5%A4%AB/">稻盛和夫</a>
    
    <a href="https://luckly.work/tags/%E7%A9%B7%E7%88%B8%E7%88%B8%E5%AF%8C%E7%88%B8%E7%88%B8/">穷爸爸富爸爸</a>
    
    <a href="https://luckly.work/tags/%E7%B2%BE%E8%BF%9B/">精进</a>
    
    <a href="https://luckly.work/tags/%E7%BC%96%E7%A8%8B/">编程</a>
    
    <a href="https://luckly.work/tags/%E8%AF%97/">诗</a>
    
    <a href="https://luckly.work/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/">读书笔记</a>
    
    <a href="https://luckly.work/tags/%E8%B4%A2%E5%8A%A1%E8%87%AA%E7%94%B1%E4%B9%8B%E8%B7%AF/">财务自由之路</a>
    
    <a href="https://luckly.work/tags/%E8%B7%91%E6%AD%A5/">跑步</a>
    
    <a href="https://luckly.work/tags/%E8%B7%AF%E7%94%B1%E4%BC%A0%E5%8F%82/">路由传参</a>
    
    <a href="https://luckly.work/tags/%E8%B7%AF%E7%BA%BF/">路线</a>
    
    <a href="https://luckly.work/tags/%E8%BD%AF%E4%BB%B6%E5%AE%9E%E6%96%BD/">软件实施</a>
    
    <a href="https://luckly.work/tags/%E9%80%9A%E8%AE%AF%E5%BD%95/">通讯录</a>
    
    <a href="https://luckly.work/tags/%E9%98%B3%E6%98%8E%E5%BF%83%E5%AD%A6/">阳明心学</a>
    
    <a href="https://luckly.work/tags/%E9%A1%B9%E7%9B%AE/">项目</a>
    
    <a href="https://luckly.work/tags/%E9%AD%85%E5%8A%9B/">魅力</a>
    
</div>
    </section>

    
<section class="widget">
    <h3 class="widget-title">友情链接</h3>
    <ul class="widget-list">
        
        <li>
            <a target="_blank" href="https://www.liwenzhou.com/" title="李文周">李文周的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="http://www.xbzweb.com/" title="小包子的博客">小包子的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="https://www.flysnow.org/" title="飞雪无情的博客">飞雪无情的博客</a>
        </li>
        
        <li>
            <a target="_blank" href="http://yuedu.baidu.com/ebook/14a722970740be1e640e9a3e" title="Android Gradle权威指南">Android Gradle权威指南</a>
        </li>
        
        <li>
            <a target="_blank" href="https://gesdh.cn/" title="小格子">格子导航</a>
        </li>
        
        <li>
            <a target="_blank" href="https://itachi.xyz/" title="阿林">itachi&#39;s Blog</a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title">其它</h3>
        <ul class="widget-list">
            <li><a href="https://luckly.work/index.xml">文章 RSS</a></li>
        </ul>
    </section>
</div>
            </div>
        </div>
    </div>
</body>

</html>